<?php

namespace Yj\Providers;

use Yj\Core\ServiceProvider;
use Hyperf\Database\Model\Collection;

class ModelCollectionProvider extends ServiceProvider
{
    public function boot()
    {
        Collection::macro('setAppends',function (array $appends){
            return $this->transform(function ($item)use($appends){
                $item->setAppends($appends);
                return $item;
            });
        });
    }
}